home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / complib / cgtsvx.z / cgtsvx
Text File  |  1998-10-30  |  9KB  |  265 lines

  1.  
  2.  
  3.  
  4. CCCCGGGGTTTTSSSSVVVVXXXX((((3333FFFF))))                                                          CCCCGGGGTTTTSSSSVVVVXXXX((((3333FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      CGTSVX - use the LU factorization to compute the solution to a complex
  10.      system of linear equations A * X = B, A**T * X = B, or A**H * X = B,
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      SUBROUTINE CGTSVX( FACT, TRANS, N, NRHS, DL, D, DU, DLF, DF, DUF, DU2,
  14.                         IPIV, B, LDB, X, LDX, RCOND, FERR, BERR, WORK, RWORK,
  15.                         INFO )
  16.  
  17.          CHARACTER      FACT, TRANS
  18.  
  19.          INTEGER        INFO, LDB, LDX, N, NRHS
  20.  
  21.          REAL           RCOND
  22.  
  23.          INTEGER        IPIV( * )
  24.  
  25.          REAL           BERR( * ), FERR( * ), RWORK( * )
  26.  
  27.          COMPLEX        B( LDB, * ), D( * ), DF( * ), DL( * ), DLF( * ), DU( *
  28.                         ), DU2( * ), DUF( * ), WORK( * ), X( LDX, * )
  29.  
  30. PPPPUUUURRRRPPPPOOOOSSSSEEEE
  31.      CGTSVX uses the LU factorization to compute the solution to a complex
  32.      system of linear equations A * X = B, A**T * X = B, or A**H * X = B,
  33.      where A is a tridiagonal matrix of order N and X and B are N-by-NRHS
  34.      matrices.
  35.  
  36.      Error bounds on the solution and a condition estimate are also provided.
  37.  
  38.  
  39. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  40.      The following steps are performed:
  41.  
  42.      1. If FACT = 'N', the LU decomposition is used to factor the matrix A
  43.         as A = L * U, where L is a product of permutation and unit lower
  44.         bidiagonal matrices and U is upper triangular with nonzeros in
  45.         only the main diagonal and first two superdiagonals.
  46.  
  47.      2. The factored form of A is used to estimate the condition number
  48.         of the matrix A.  If the reciprocal of the condition number is
  49.         less than machine precision, steps 3 and 4 are skipped.
  50.  
  51.      3. The system of equations is solved for X using the factored form
  52.         of A.
  53.  
  54.      4. Iterative refinement is applied to improve the computed solution
  55.         matrix and calculate error bounds and backward error estimates
  56.         for it.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CCCCGGGGTTTTSSSSVVVVXXXX((((3333FFFF))))                                                          CCCCGGGGTTTTSSSSVVVVXXXX((((3333FFFF))))
  71.  
  72.  
  73.  
  74. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  75.      FACT    (input) CHARACTER*1
  76.              Specifies whether or not the factored form of A has been supplied
  77.              on entry.  = 'F':  DLF, DF, DUF, DU2, and IPIV contain the
  78.              factored form of A; DL, D, DU, DLF, DF, DUF, DU2 and IPIV will
  79.              not be modified.  = 'N':  The matrix will be copied to DLF, DF,
  80.              and DUF and factored.
  81.  
  82.      TRANS   (input) CHARACTER*1
  83.              Specifies the form of the system of equations:
  84.              = 'N':  A * X = B     (No transpose)
  85.              = 'T':  A**T * X = B  (Transpose)
  86.              = 'C':  A**H * X = B  (Conjugate transpose)
  87.  
  88.      N       (input) INTEGER
  89.              The order of the matrix A.  N >= 0.
  90.  
  91.      NRHS    (input) INTEGER
  92.              The number of right hand sides, i.e., the number of columns of
  93.              the matrix B.  NRHS >= 0.
  94.  
  95.      DL      (input) COMPLEX array, dimension (N-1)
  96.              The (n-1) subdiagonal elements of A.
  97.  
  98.      D       (input) COMPLEX array, dimension (N)
  99.              The n diagonal elements of A.
  100.  
  101.      DU      (input) COMPLEX array, dimension (N-1)
  102.              The (n-1) superdiagonal elements of A.
  103.  
  104.      DLF     (input or output) COMPLEX array, dimension (N-1)
  105.              If FACT = 'F', then DLF is an input argument and on entry
  106.              contains the (n-1) multipliers that define the matrix L from the
  107.              LU factorization of A as computed by CGTTRF.
  108.  
  109.              If FACT = 'N', then DLF is an output argument and on exit
  110.              contains the (n-1) multipliers that define the matrix L from the
  111.              LU factorization of A.
  112.  
  113.      DF      (input or output) COMPLEX array, dimension (N)
  114.              If FACT = 'F', then DF is an input argument and on entry contains
  115.              the n diagonal elements of the upper triangular matrix U from the
  116.              LU factorization of A.
  117.  
  118.              If FACT = 'N', then DF is an output argument and on exit contains
  119.              the n diagonal elements of the upper triangular matrix U from the
  120.              LU factorization of A.
  121.  
  122.      DUF     (input or output) COMPLEX array, dimension (N-1)
  123.              If FACT = 'F', then DUF is an input argument and on entry
  124.              contains the (n-1) elements of the first superdiagonal of U.
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. CCCCGGGGTTTTSSSSVVVVXXXX((((3333FFFF))))                                                          CCCCGGGGTTTTSSSSVVVVXXXX((((3333FFFF))))
  137.  
  138.  
  139.  
  140.              If FACT = 'N', then DUF is an output argument and on exit
  141.              contains the (n-1) elements of the first superdiagonal of U.
  142.  
  143.      DU2     (input or output) COMPLEX array, dimension (N-2)
  144.              If FACT = 'F', then DU2 is an input argument and on entry
  145.              contains the (n-2) elements of the second superdiagonal of U.
  146.  
  147.              If FACT = 'N', then DU2 is an output argument and on exit
  148.              contains the (n-2) elements of the second superdiagonal of U.
  149.  
  150.      IPIV    (input or output) INTEGER array, dimension (N)
  151.              If FACT = 'F', then IPIV is an input argument and on entry
  152.              contains the pivot indices from the LU factorization of A as
  153.              computed by CGTTRF.
  154.  
  155.              If FACT = 'N', then IPIV is an output argument and on exit
  156.              contains the pivot indices from the LU factorization of A; row i
  157.              of the matrix was interchanged with row IPIV(i).  IPIV(i) will
  158.              always be either i or i+1; IPIV(i) = i indicates a row
  159.              interchange was not required.
  160.  
  161.      B       (input) COMPLEX array, dimension (LDB,NRHS)
  162.              The N-by-NRHS right hand side matrix B.
  163.  
  164.      LDB     (input) INTEGER
  165.              The leading dimension of the array B.  LDB >= max(1,N).
  166.  
  167.      X       (output) COMPLEX array, dimension (LDX,NRHS)
  168.              If INFO = 0, the N-by-NRHS solution matrix X.
  169.  
  170.      LDX     (input) INTEGER
  171.              The leading dimension of the array X.  LDX >= max(1,N).
  172.  
  173.      RCOND   (output) REAL
  174.              The estimate of the reciprocal condition number of the matrix A.
  175.              If RCOND is less than the machine precision (in particular, if
  176.              RCOND = 0), the matrix is singular to working precision.  This
  177.              condition is indicated by a return code of INFO > 0, and the
  178.              solution and error bounds are not computed.
  179.  
  180.      FERR    (output) REAL array, dimension (NRHS)
  181.              The estimated forward error bound for each solution vector X(j)
  182.              (the j-th column of the solution matrix X).  If XTRUE is the true
  183.              solution corresponding to X(j), FERR(j) is an estimated upper
  184.              bound for the magnitude of the largest element in (X(j) - XTRUE)
  185.              divided by the magnitude of the largest element in X(j).  The
  186.              estimate is as reliable as the estimate for RCOND, and is almost
  187.              always a slight overestimate of the true error.
  188.  
  189.      BERR    (output) REAL array, dimension (NRHS)
  190.              The componentwise relative backward error of each solution vector
  191.              X(j) (i.e., the smallest relative change in any element of A or B
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. CCCCGGGGTTTTSSSSVVVVXXXX((((3333FFFF))))                                                          CCCCGGGGTTTTSSSSVVVVXXXX((((3333FFFF))))
  203.  
  204.  
  205.  
  206.              that makes X(j) an exact solution).
  207.  
  208.      WORK    (workspace) COMPLEX array, dimension (2*N)
  209.  
  210.      RWORK   (workspace) REAL array, dimension (N)
  211.  
  212.      INFO    (output) INTEGER
  213.              = 0:  successful exit
  214.              < 0:  if INFO = -i, the i-th argument had an illegal value
  215.              > 0:  if INFO = i, and i is
  216.              <= N:  U(i,i) is exactly zero.  The factorization has not been
  217.              completed unless i = N, but the factor U is exactly singular, so
  218.              the solution and error bounds could not be computed.  = N+1:
  219.              RCOND is less than machine precision.  The factorization has been
  220.              completed, but the matrix is singular to working precision, and
  221.              the solution and error bounds have not been computed.
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.